package com.ws.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ws.entity.Menu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MenuMapper extends BaseMapper<Menu> {

    @Select("select     " +
            "m.id,    " +
            "m.`name`,    " +
            "m.icon,    " +
            "m.url,    " +
            "m.pid,    " +
            "m.remark,    " +
            "m.`level`,    " +
            "m.is_link    " +
            "from     " +
            "shop_menu m     " +
            "join     " +
            "shop_menu_role r     " +
            "on     " +
            "r.menu_id = m.id    " +
            "where    " +
            "r.role_id = ${roleId}    ")
    List<Menu> getMenuListByRoleId(@Param("roleId") Long roleId);
}
